<%--
  Created by IntelliJ IDEA.
  User: taohj
  Date: 2014/6/29
  Time: 18:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<c:set var="menu" value="none" scope="request"></c:set>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://"
            + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<!Doctype html>
<html>
<head>
    <base href="<%=basePath%>">
    <title>政府数据开放平台</title>
    <jsp:include page="../../commons/include.jsp"/>

    <link href="/resources/css/lib.css" rel="stylesheet">



    <script>
        $(document).ready(function(){

            $("form input[value='上传']").on('click',function(){
                // $("form input[name='file']").click();
                $("form input[name='file']").css('display','inline');
                $("form input[value='上传']").hide();
                $("form input[value='链接']").hide();
                $("form input[value='预览']").hide();

                $("form input[type='file']").show();
                $("form input[value='取消']:last").show();
                $("form input[value='取消']:last").css('display','inline');

                $("form input[name='storage']").val(131);

            });

            $("form input[value='链接']").on('click',function(){
                $("form input[name='url']").show();
                $("form input[name='url']").css('display','inline');
                $("form input[value='取消']:first").show();
                $("form input[value='取消']:first").css('display','inline');
                $("form input[value='上传']").hide();
                $("form input[value='链接']").hide();

                $("form input[value='预览']").hide();
                $("form input[name='storage']").val(132);

            });

            $("form input[value='取消']:first").on('click',function(){
                $(this).hide();
                $("form input[name='url']").hide();
                $("form input[value='上传']").show();
                $("form input[value='链接']").show();
                $("form input[value='预览']").show()
                $("form input[name='storage']").val('');




            });

            $("form input[value='取消']:last").on('click',function(){
                $(this).hide();
                $("form input[name='url']").hide();
                $("form input[value='上传']").show();
                $("form input[value='链接']").show();
                $("form input[name='file']").hide();
                $("form input[value='预览']").show();
                $("form input[name='storage']").val('');

            });

            $("form input[value='预览']").on('click',function(){
                var url=$(this).attr('url');
                window.open(url);
            });



        });
    </script>

</head>
<body>



<jsp:include page="../../commons/top.jsp"/>
<div class="main">


    <jsp:include page="../../commons/dashboardMenu.jsp"/>


    <div>
        <div>
            <form method="post" action="/front/my/app/modify" enctype="multipart/form-data">

                <input type="hidden" name="id" value="${requestScope.app.id}">
                <input type="hidden" name="storage" value="${requestScope.app.storage.id}">


                <table class="updateTable">
                    <tr>
                        <td>名称:</td>
                        <td><input type="text" name="name" value="${requestScope.app.name}"></td>
                    </tr>


                    <tr>
                        <td>APP:</td>
                       <td>
                           <input type="button" class="form-control" style="width: 60px; display: inline" value="上传">
                           <input type="button" class="form-control" style="width: 60px; display: inline" value="链接">
                           <input type="file" name="file" class="form-control" style="display: none">
                           <input type="text" name="url" class="form-control" style="display: none;height: 34px; ">
                           <input type="button" class="form-control" style="width: 50px;display: none;" value="取消">
                           <input type="button" class="form-control" style="width: 50px;display: none;" value="取消">
                           <input type="button" class="form-control" url="${requestScope.app.url}" style="width: 50px;display: inline" value="预览">
                       </td>
                    </tr>


                    <tr>
                        <td>图片:</td>
                        <td>
                            <img src="${app.image}" width="40" height="40">
                            <br/>
                            <input  type="file" name="image">
                        </td>
                    </tr>



                    <tr>
                        <td>平台:</td>
                        <td>
                            <select name="platform" dataSync='true' syncType='appPlatform' dictionaryType='APP_PLATFORM' selectValue='${requestScope.app.platform.id}' ></select>
                        </td>
                    </tr>


                    <tr>
                        <td>主题:</td>
                        <td>
                            <select  name="theme" dataSync='true' syncType='apptheme'  selectValue='${requestScope.app.theme.id}' > </select>
                        </td>
                    </tr>


                    <tr>
                        <td>是否公开:</td>
                        <td>
                            <input type="radio"  name="visibility" dataSync='true' syncType='dictionary' dictionaryType='VISIBILITY' checkedValue="${requestScope.app.visibility.id}">
                        </td>
                    </tr>


                    <tr>
                        <td>标签:</td>
                        <td><input type="text" name="tags" value="${requestScope.app.tags}"></td>
                    </tr>

                    <tr>
                        <td>当前版本:</td>
                        <td><input type="text" name="version" value="${requestScope.app.version}"></td>
                    </tr>

                    <tr>
                        <td>开发者:</td>
                        <td>
                            <input type="text" name="developer" value="${requestScope.app.developer}">
                        </td>
                    </tr>


                    <tr>
                        <td>电话:</td>
                        <td>
                            <input type="text" name="developerPhone" value="${requestScope.app.developerPhone}">
                        </td>
                    </tr>

                    <tr>
                        <td>LinkData:</td>
                        <td>
                            <input type="text" name="linkdata" value="${requestScope.app.linkdata}"/>
                        </td>
                    </tr>



                    <tr>
                        <td>简 介:</td>
                        <td><textarea name="description" rows="8">${requestScope.app.description}</textarea></td>
                    </tr>



                    <tr>
                        <td colspan="2" style="text-align: left;padding-left: 200px;"><input type="submit" value="更   新"/></td>
                    </tr>
                </table>



            </form>
        </div>
    </div>


</div>
<jsp:include page="../../commons/buttom.jsp"/>
</body>
</html>
